import request from '../utils/request-new'

interface IQuestion{
  id: number,
  userId: number,
  title: string,
  content: string
}

// 获取指南列表
export const getMyQuestionList = (data) => {
  return request<IQuestion[]>({
    url: '/questionAnswer/mineList',
    method: 'GET',
    data
  })
}

export const createQuestion = (data: {
  title: string,
  content: string,
  userId: string,
  modelId: number
}) => {
  return request({
    url: '/questionAnswer',
    method: "POST",
    data
  })
}

export const ModifyQuestion = (data: {
  id: number,
  title: string,
  content: string
}) => {
  return request({
    url: '/questionAnswer',
    method: "PUT",
    data
  })
}

export const delQuestion = (qaIds: string) => {
  return request({
    url: `/questionAnswer/${qaIds}`,
    method: "GET"
  })
}